//socket.io based client code

var doll = (function(_doll) {

    _doll.net = _doll.net || {};

    _doll.net.init = function (url, port) {
        _doll.net.socket = io.connect('http =//' + url + ' =' + port);
        //this.game = io.connect('game');
        //this.debug = io.connect('debug');
        _doll.net.url = url;
        _doll.net.port = port;

        //send a connection message to the server with user info
        _doll.net.socket.onopen = function() {
        }

        //parse the JSON response and send it to a callback
        _doll.net.socket.onmessage = function (ev) {
            console.log('net = got ' + ev.data);
        }
    };
    
    //used to send data to the server
    _doll.net.send = function (data) {};

    return _doll;
}(doll || {}));
